<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html class="login-bg">
<head>
	<title>E8NET - Sign up</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- bootstrap -->
<link href="/dianm/Public/Admin/css/bootstrap/bootstrap.css" rel="stylesheet" />
<link href="/dianm/Public/Admin/css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
<link href="/dianm/Public/Admin/css/bootstrap/bootstrap-overrides.css" type="text/css" rel="stylesheet" />

<!-- global styles -->
<link rel="stylesheet" type="text/css" href="/dianm/Public/Admin/css/layout.css" />
<link rel="stylesheet" type="text/css" href="/dianm/Public/Admin/css/elements.css" />
<link rel="stylesheet" type="text/css" href="/dianm/Public/Admin/css/icons.css" />

<!-- libraries -->
<link href="/dianm/Public/Admin/css/lib/bootstrap-wysihtml5.css" type="text/css" rel="stylesheet" />
<link href="/dianm/Public/Admin/css/lib/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css" />
<link href="/dianm/Public/Admin/css/lib/font-awesome.css" type="text/css" rel="stylesheet" />
<link href="/dianm/Public/Admin/css/lib/morris.css" type="text/css" rel="stylesheet" />
<link href="/dianm/Public/Admin/css/popup.css" type="text/css" rel="stylesheet" />



<!-- open sans font -->
<!--<link href='http://fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css' />-->

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<link href="/dianm/Public/Libs/confirm/jquery.confirm.css" type="text/css" rel="stylesheet" />


    <link rel="stylesheet" href="/dianm/Public/Admin/css/compiled/signup.css" type="text/css" media="screen" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <div class="header">
        <a href="index.html">
            <img src="/dianm/Public/Admin/img/logo.png" class="logo" />
        </a>
    </div>
    <div class="row-fluid login-wrapper">
        <div class="box">
            <div class="content-wrap">
                <h6>登录</h6>
                <input class="span12" id="act" name="account" type="text" placeholder="Account" />
                <input class="span12" id="pwd" name="password" type="password" placeholder="Password" />
                <input id="rol" type="hidden" name="role" value="super" />

                <div class="btn-group toggle-inputs hidden-tablet">
                    <button class="glow left active" data-input="super">总管理员</button>
                    <button class="glow right" data-input="department">系管理员</button>
                    <button class="glow right" data-input="teacher">教师</button>
                </div><br>

                <span id="msg" style="display: none; color:darkred">
                    <i class="icon-remove-sign"></i>
                    <small></small>
                </span>

                <div class="action">
                    <a class="btn-flat info" href="javascript:login();">Login up</a>
                </div>                
            </div>
        </div>

        <div class="span4 already">
            <p>Forget Password?</p>
            <a href="signin.html">Find</a>
        </div>
    </div>

	<!-- scripts -->
    <script src="/dianm/Public/Admin/js/jquery-latest.js"></script>
    <script src="/dianm/Public/Admin/js/bootstrap.min.js"></script>
    <script src="/dianm/Public/Admin/js/theme.js"></script>
    <script src="/dianm/Public/Admin/js/tools.js"></script>

    <script type="text/javascript">
        $(function () {
            var $buttons = $(".toggle-inputs button");
            $buttons.click(function () {
                var val = $(this).data("input");
                $('#rol').val(val);
                $buttons.removeClass("active");
                $(this).addClass("active");
            });
        });
    </script>

    <script>

        function login() {

            var account = $('#act').val();
            var password = $('#pwd').val();
            var role = $('#rol').val();

            if (account == "" || password == "") {
                $('#msg > small').html('账号/密码不能为空');
                $('#msg').show();
                return;
            }

            $.post('/dianm/admin.php?c=Login&a=login',{role:role,account:account,password:password},function(result){
                var obj = eval('(' + result + ')');
                if (obj.result == "RESULT_OK") {
                    window.location.href = obj.data;
                } else {
                    $('#msg > small').html(obj.msg);
                    $('#msg').show();
                }
            });
        }
    </script>

</body>
</html>